<?php
	require_once "dSendMail2.inc.php";
	
	// First of all: DISABLE TIME LIMIT and IGNORE USER ABORT! You really don't want to be interrupted in the middle of this.
	set_time_limit(0);
	ignore_user_abort(true);
		
	function sendMail($to,$subject,$message,$fromAddress='',$fromUserName='',$toName='',$bcc='')
	{
		if($fromUserName==''){
			$fromUserName = 'NTRA Web Support';
		}
		if($fromAddress==''){
			$fromAddress = 'donot-reply@ntra.com';
		}
		$m = new dSendMail2;
		$m->setTo($to);
		$m->setFrom($fromUserName."<".$fromAddress.">");
		$m->setSubject($subject);
		$m->setMessage($message);
		
		$m->headers['MIME-Version'] ='1.0'."\r\n";
		$m->headers['Content-type']  = 'text/html; charset=iso-8859-1'. "\r\n";
		

		if($bcc!=''){
			$m->setBcc($bcc);
		}	
		
		$m->send();
	}
	
	
?>